#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int Digitsum (unsigned int num)
{
  if(num>9)
  {
	  return Digitsum(num/10)+num%10;
  }
  else
  {
	  return num;
  }

}
int main ()
{
 int num2=0;
 unsigned int num1=0;
 scanf("%d",&num1);
 num2 = Digitsum(num1);
 printf("%d\n",num2);
 return 0;
}